package com.example.order_product.Entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;


@Data
@TableName("products")
public class Product {
    @TableId(type = IdType.AUTO)
    private int id;
    @NotBlank(message = "产品名称不能为空")
    private String name;
    @NotNull(message = "产品价格不能为空")
    private Double price;
    @NotNull(message = "库存不能为空")
    private Integer stock;
    @NotBlank(message = "描述不能为空")
    @Size(max = 500, message = "描述长度不能超过 500 个字符")
    private String description;
}
